package tk.mybatis.springboot.conf;


import tk.mybatis.springboot.model.UserInfo;

/**
 * Created by mbji on 2018/11/14.
 */
public class UserInfoContextHolder {
    private static final ThreadLocal<UserInfo> USER_CONTEXT_HOLDER = new ThreadLocal();

    private UserInfoContextHolder() {
    }

    public static UserInfo getUserInfo() {
        return USER_CONTEXT_HOLDER.get();
    }

    public static void setUserInfo(UserInfo UserInfo) {
        USER_CONTEXT_HOLDER.set(UserInfo);
    }

    public static void remove() {
        USER_CONTEXT_HOLDER.remove();
    }
}
